package ui.panel.transfers {
	
	import flash.display.Bitmap;
	import flash.display.Sprite;
	
	import globals.Global;
	
	import ui.component.Label;
	import ui.component.TextButton;
	
	import util.UIUtil;
	
	public class TransferNeed extends Sprite {
		
		private var icon:Bitmap;
		private var conditionLabel:Label;
		private var goldLabel:Label;
		private var silverLabel:Label;
		private var timeLabel:Label;
		private var transferButton:TextButton;

		public function TransferNeed() {
			super();
			
			icon = new Bitmap();
			addChild(icon);
			icon.bitmapData = Global.assetsManager.getAssetsAsBitmapData("", "ui");
			
			var label:Label;
			label = new Label(12, 0xFFFFFF);
			label.x = 10;
			label.y = 100;
			label.text = "转职需求：";
			
			conditionLabel = new Label(12, 0xFFFFFF);
			conditionLabel.x = 20;
			conditionLabel.y = 130;
			addChild(conditionLabel);
			silverLabel = new Label(12, 0xFFFFFF);
			silverLabel.x = 20;
			silverLabel.y = 150;
			addChild(silverLabel);
			goldLabel = new Label(12, 0xFFFFFF);
			goldLabel.x = 20;
			goldLabel.y = 170;
			addChild(goldLabel);
			
			timeLabel = new Label(12, 0xFFFFFF);
			timeLabel.x = 20;
			timeLabel.y = 200;
			addChild(timeLabel);
			
			transferButton = UIUtil.getTextButton("转职", [], transferHandler);
			transferButton.x = 20;
			transferButton.y = 200;
			addChild(transferButton):
		}
		
		private function transferHandler(button:TextButton):void {
			
		}
		
		public function update(condition:String, silver:uint, gold:uint, time:uint):void {
			conditionLabel.text = condition;
			silverLabel.text = silver.toString();
			goldLabel.text =  gold.toString();
			timeLabel.text = "还可以晋级" + time.toString() + "次";
		}
		
		public function clear():void {
			
		}
	}
}